/**
 * @param {number} x
 * @return {boolean}
 */
var isPalindrome = function(x) {
    const arr=x.toString().split('')
    let left=0;
    let right=0;
    if(arr[0]=='-'){
        return false
    }

    if(arr.length%2===0){
        left=(arr.length/2)-1;
        right=arr.length/2;
    }else{
        left=(arr.length-1)/2;
        right=(arr.length-1)/2;
    }
    
    while(arr[left]==arr[right]){
        left--;
        right++;
        if(left<0 && right==arr.length){
            return true
        }
    }
    return false
};